Annex C describes the OPC UA specific requirements which are above and beyond the more general requirements of the mDNS specification.

mDNS uses DNS SRV records to advertise the services (a.k.a. the DiscoveryUrls for the Servers) available on the network.

An SRV record has the form:

_service._proto.name TTL class SRV priority weight port target

service: the symbolic name of the desired service. For OPC UA this field shall be one of service names for OPC UA which are defined in Table 115.

Table 115 – Allowed mDNS Service Names

Service Name

Description

_opcua-tcp

The DiscoveryUrl supports the OPC UA TCP mapping (see OPC 10000-6).

This name is assigned by IANA.

_opcua-tls

The DiscoveryUrl supports the OPC UA WebSockets mapping (see OPC 10000-6).

Note that WebSockets mapping supports multiple encodings. If a Client supports more than one encoding it should attempt to use the alternate encodings if an error occurs during connect.

This name is assigned by IANA.

proto: the transport protocol of the desired service; For OPC UA this field shall be ‘_tcp’.

The other fields have no OPC UA specific requirements.

An example SRV record in textual form that might be found in a zone file might be the following:

_opcua-tcp._tcp.example.com. 86400 IN SRV 0 5 4840 uaserver.example.com.

This points to a server named uaserver.example.com listening on TCP port 4840 for OPC UA TCP requests. The priority given here is 0, and the weight is 5 (the priority and weights are not important for OPC UA). The mDNS specification describes the rest of the fields in detail.

The SRV record has a TXT record associated with it that provides additional information about the DiscoveryUrl. The format of this record is a sequence of strings prefixed by a length. This specification adopts the key-value syntax for TXT records described in DNS-SD.

Table 116 defines the syntax for strings that may in the TXT record.

Table 116 – DNS TXT Record String Format

Key-Value Format

Description

path=/<path>

Specifies the text that appears after the port number when constructing a URL. This text always starts with a forward slash (/).

caps=<capability1>,<capability2>

Specifies the capabilities supported by the Server.

These are short (<=8 character) strings which are published by the OPC Foundation (see Annex D). The number of capabilities supported by a Server should be less than 10.

The MulticastExtension shall convert DiscoveryUrls to and from these SRV records.

An DiscoveryUrl has the form:

scheme://hostname:port/path

scheme: the protocol used to establish a connection.

hostname: the domain name or IPAddress of the host where the Server is running.

port: the TCP port on which the Server is to be found.

path: additional data used to identify a specific Server.

Table 117 – DiscoveryUrl to DNS SRV and TXT Record Mapping

URL Field

Mapping

scheme

The scheme maps onto SRV record service field.

The following mappings are defined at this time:

opc.tcp

_opcua-tcp._tcp.

opc.wss

_opcua-tls._tcp.

https

_opcua-https._tcp.

The first two are OPC UA service names assigned by IANA.

Additional service names may be added in the future.

The endpoint shall support the default transport profile for the scheme.

hostname

The hostname maps onto the SRV record target field.

If the hostname is an IPAddress then it shall be converted to a domain name.

If this cannot be done then LDS shall report an error.

port

The port maps onto the SRV record port field.

path

The path maps onto the path string in the TXT record (see Table 116).

Suitable default values should be chosen for fields in a SRV record that do not have a mapping specified in Table 117. e.g. TTL=86400, class=IN, priority=0, weight=5